// BasicUserManagement.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include "BasicUserManagement.h"
#include "UserList.h"

static CUserList m_sMainUserList;

BASICUSERMANAGEMENT_API void LoadUserData(char *szFileName, size_t ullSize)
{
   m_sMainUserList.LoadUsersFromFile(szFileName, ullSize);
}

BASICUSERMANAGEMENT_API void SaveUserData(char *szFileName, size_t ullSize)
{
   m_sMainUserList.SaveUsersToFile(szFileName, ullSize);
}

BASICUSERMANAGEMENT_API bool IsUserNameAvailable(char *szUserName, size_t ullSize)
{
   return m_sMainUserList.UserExists(szUserName, ullSize);
}

BASICUSERMANAGEMENT_API void AddNewUserName(char *szUserName, size_t ullSize)
{
   m_sMainUserList.AddUser(szUserName, ullSize);
}

BASICUSERMANAGEMENT_API void SetPasswordForUser(char *szUserName, size_t ullUNSize, char *szPass, size_t ullPWSize)
{
   m_sMainUserList.SetPass(szUserName, ullUNSize, szPass, ullPWSize);
}

BASICUSERMANAGEMENT_API void RemoveExistingUser(char *szUserName, size_t ullUNSize)
{
   m_sMainUserList.RemoveUser(szUserName, ullUNSize);
}

BASICUSERMANAGEMENT_API bool ValidateUserAndPass(char *szUserName, size_t ullUNSize, char *szPass, size_t ullPWSize)
{
   return m_sMainUserList.ValidateUser(szUserName, ullUNSize, szPass, ullPWSize);
}

BASICUSERMANAGEMENT_API void ClearAllUsers()
{
   m_sMainUserList.ClearUsers();
}